<?php
/**
 *	Main Class of BugTracker to realize Actions and build Views.
 *	@package		tools.BugTracker
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			01.11.2005
 *	@version		1.0
 */
/**
 *	Main Class of BugTracker to realize Actions and build Views.
 *	@package		tools.BugTracker
 *	@extends		CMF_Krypton_Base
 *	@uses			Language
 *	@uses			MySQL
 *	@uses			IniReader
 *	@uses			PartitionSession
 *	@uses			DirectedWeightedGraph
 *	@uses			LanguageValidator
 *	@uses			FieldDefinition
 *	@uses			User
 *	@uses			MailSender
 *	@uses			Authentification
 *	@uses			AuthActions
 *	@uses			AuthViews
 *	@uses			InterfaceViews
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			01.11.2005
 *	@version		1.0
 */
class BugTracker extends CMF_Krypton_Application_Web
{	
	/**
	 *	Creates references Objects and loads Configuration.
	 *	@access		public
	 *	@return		void
	 */
	public function __construct( CMF_Krypton_Environment_Web $env )
	{
		parent::__construct( $env );

/*		$ir			= new File_INI_Reader( "config/rss.ini", true );
		$config['rss']	= $ir->toArray();
		$ir			= new File_INI_Reader( "config/subfooter.ini", true );
		$config['subfooter']	= $ir->toArray();
		$this->registry->set( "config",	$config );
*/
		$config	= $this->env->getRegistry()->get( 'config' );
		define( "JPGRAPH_PATH", $config['paths.jpgraph'] );

		//  --  UI COMPONENTS  --  //
		$mail		= new MailSender;
		$this->env->getRegistry()->set( "mail", $mail );

//		$this->initStatusGraph();
	}

	protected function initStatusGraph()
	{
		//  --  STATUS MODEL  --  //
		$graph = new ADT_Graph_DirectedWeightedGraph();
		$node_1	= $graph->addNode( "-1" );
		$node0	= $graph->addNode( "0" );
		$node1	= $graph->addNode( "1" );
		$node2	= $graph->addNode( "2" );
		$node3	= $graph->addNode( "3" );
		$node4	= $graph->addNode( "4" );

		$graph->addEdge( $node_1, $node_1 );
		$graph->addEdge( $node_1, $node1 );
		$graph->addEdge( $node_1, $node4 );
		$graph->addEdge( $node0, $node0 );
	//	$graph->addEdge( $node0, $node1 );
		$graph->addEdge( $node0, $node2 );
		$graph->addEdge( $node1, $node_1 );
		$graph->addEdge( $node1, $node1 );
		$graph->addEdge( $node1, $node2 );
		$graph->addEdge( $node2, $node2 );
		$graph->addEdge( $node2, $node3 );
		$graph->addEdge( $node2, $node4 );
		$graph->addEdge( $node3, $node2 );
		$graph->addEdge( $node3, $node3 );
		$graph->addEdge( $node3, $node_1 );
		$graph->addEdge( $node4, $node3 );
		$graph->addEdge( $node4, $node4 );
		$this->registry->set( "graph", $graph );
	}

	/**
	 *	Loads Class of User Interface.
	 *	@access		protected
	 *	@return		void
	 */
	protected function initUserInterface()
	{
		$this->interface	= new View_Interface;
	}


}
?>